<?php
/**
 * user
 * @OA\Schema(
 *       schema="User",
 *       description="User-用户",
 *       required={"username","email"},
 *       @OA\Property(
 *            property="id",
 *            type="number"
 *       ),
 *      @OA\Property(
 *            property="username",
 *            type="string",
 *            description="用户名"
 *       ),
 *       @OA\Property(
 *            property="password",
 *            type="string",
 *            description="用户密码"
 *      ),
 *       @OA\Property(
 *            property="email",
 *            type="string",
 *            description="邮箱"
 *      ),
 *       @OA\Property(
 *            property="avatar",
 *            type="string",
 *            description="用户头像"
 *      ),
 *       @OA\Property(
 *            property="remember_token",
 *            type="string",
 *            description="用户token"
 *      ),
 *     @OA\Property(
 *            property="creator_id",
 *            type="number",
 *            description="创建人ID",
 *       ),
 *     @OA\Property(
 *            property="department_id",
 *            type="number",
 *            description="部门ID",
 *       ),
 *     @OA\Property(
 *            property="status",
 *            type="number",
 *            description="用户状态 1 正常 2 禁用",
 *       ),
 *     @OA\Property(
 *            property="last_login_ip",
 *            type="number",
 *            description="最后登录IP",
 *       ),
 *     @OA\Property(
 *            property="last_login_time",
 *            type="number",
 *            description="最后登录时间",
 *       ),
 *     @OA\Property(
 *            property="created_at",
 *            type="string",
 *            description="创建时间"
 *       ),
 *     @OA\Property(
 *            property="updated_at",
 *            type="string",
 *            description="更新时间",
 *     ),
 *     @OA\Property(
 *            property="deleted_at",
 *            type="string",
 *            description="删除状态，null 未删除 timestamp 已删除",
 *     )
 * )
 *
 * @OA\Schema(
 *       schema="CurrentUser",
 *       description="CurrentUser-当前用户",
 *       required={"job_name","status"},
 *       allOf={
 *          @OA\Schema(ref="#/components/schemas/User"),
 *          @OA\Schema(
 *              @OA\Property(
 *                 property="permissions",
 *                 type="array",
 *                 description="权限",
 *                 @OA\Items(ref="#/components/schemas/Permissions")
 *              ),
 *              @OA\Property(
 *                 property="roles",
 *                 type="array",
 *                 description="角色",
 *                 @OA\Items(type="string")
 *              ),
 *          ),
 *      }
 * )
 *
 *
 *
 * @OA\Get(path="/users",
 *   tags={"users"},
 *   summary="用户列表",
 *   operationId="getUsers",
 *   security={{"Authorization-Bearer":{}}},
 *   @OA\Parameter(ref="#/components/parameters/pageSize"),
 *   @OA\Parameter(ref="#/components/parameters/current"),
 *   @OA\Parameter(ref="#/components/parameters/keyword"),
 *   @OA\Response(response="200", description="Success",
 *       @OA\JsonContent(ref="#/components/schemas/QueryResponse")
 *   )
 * )
 *
 * @OA\Get(path="/user/export",
 *   tags={"users"},
 *   summary="导出用户列表",
 *   operationId="exportUsers",
 *   security={{"Authorization-Bearer":{}}},
 *   @OA\Response(response="200", description="Success",
 *       @OA\JsonContent(ref="#/components/schemas/QueryResponse")
 *   )
 * )
 *
 * @OA\Post(path="/users",
 *   tags={"users"},
 *   summary="创建用户",
 *   operationId="createUser",
 *   security={{"Authorization-Bearer":{}}},
 *   @OA\RequestBody(
 *     @OA\MediaType(
 *       mediaType="application/json",
 *         @OA\Schema(ref="#/components/schemas/User")
 *       )
 *     ),
 *   @OA\Response(response="200", description="Success",
 *       @OA\JsonContent(ref="#/components/schemas/HandleResponse")
 *   )
 * )
 *
 *
 * @OA\Put(path="/users/{id}",
 *   tags={"users"},
 *   summary="更新用户",
 *   operationId="updateUser",
 *   security={{"Authorization-Bearer":{}}},
 *   @OA\Parameter(ref="#/components/parameters/id"),
 *   @OA\RequestBody(
 *     @OA\MediaType(
 *       mediaType="application/json",
 *         @OA\Schema(ref="#/components/schemas/User")
 *       )
 *     ),
 *   @OA\Response(response="200", description="Success",
 *       @OA\JsonContent(ref="#/components/schemas/HandleResponse")
 *   )
 * )
 *
 * @OA\Put(path="/users/switch/status/{id}",
 *   tags={"users"},
 *   summary="切换状态",
 *   operationId="switchUserStatus",
 *   security={{"Authorization-Bearer":{}}},
 *   @OA\Parameter(ref="#/components/parameters/id"),
 *   @OA\Response(response="200", description="Success",
 *       @OA\JsonContent(ref="#/components/schemas/HandleResponse")
 *   )
 * )
 *
 * @OA\Delete (path="/users/{id}",
 *   tags={"users"},
 *   summary="删除用户",
 *   operationId="deleteUser",
 *   security={{"Authorization-Bearer":{}}},
 *   @OA\Parameter(ref="#/components/parameters/id"),
 *   @OA\Response(response="200", description="Success",
 *       @OA\JsonContent(ref="#/components/schemas/HandleResponse")
 *   )
 * )
 *
 * @OA\Get(path="/user/info",
 *   tags={"users"},
 *   summary="获取个人信息",
 *   operationId="getCurrentUser",
 *   security={{"Authorization-Bearer":{}}},
 *   @OA\Response(response="200", description="Success",
 *       @OA\JsonContent(ref="#/components/schemas/HandleResponse")
 *   )
 * )
 *
 * @OA\Put(path="/user/profile",
 *   tags={"users"},
 *   summary="更新个人信息",
 *   operationId="updateCurrentUser",
 *   security={{"Authorization-Bearer":{}}},
 *   @OA\RequestBody(
 *     @OA\MediaType(
 *       mediaType="application/json",
 *         @OA\Schema(ref="#/components/schemas/User")
 *       )
 *     ),
 *   @OA\Response(response="200", description="Success",
 *       @OA\JsonContent(ref="#/components/schemas/HandleResponse")
 *   )
 * )
 */